Skip to content

fix: scripts: mp1 series eth pin config #287

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

arifbalik
Copy link
Contributor

STM32MP1 series has different Ethernet namings than what is specified in stm32-pinctrl-config.yaml, so I did put another config file with one regex; ETH[12]_(CLK|COL|CRS|CRS_DV|GTX_CLK|MDC|MDIO|PHY_INTN|PPS_OUT|REF_CLK|RX_CLK|RX_CTL|RX_DV|RX_ER|RXD|TX_CLK|TX_CTL|TX_EN|TX_ER|TXD)

arifbalik added a commit to arifbalik/hal_stm32 that referenced this pull request Jun 14, 2025
Updated the pins based on zephyrproject-rtos#287

Signed-off-by: Arif Balik <[email protected]>
arifbalik added a commit to arifbalik/hal_stm32 that referenced this pull request Jun 14, 2025
Updated the pins based on zephyrproject-rtos#287

Signed-off-by: Arif Balik <[email protected]>
arifbalik added a commit to arifbalik/hal_stm32 that referenced this pull request Jun 15, 2025
Updated the pins based on zephyrproject-rtos#287

Signed-off-by: Arif Balik <[email protected]>
@arnopo
Copy link
Contributor

arnopo commented Jun 24, 2025

hello @arifbalik

Thanks for your contribution! Please find below few comments:

@arifbalik
Copy link
Contributor Author

I was trying to bring up ethernet on stm32mp1 and realized the pin data is quite different than what was specified in the default yml file, I'll see if I can put it inside the default one but it seems unlikely.

Also last time I updated the pinctrl files @erwango suggested that I should open another PR for the dtsi files since they were quite large, i can put it here as well

@erwango
Copy link
Member

erwango commented Jun 24, 2025

I updated the pinctrl files @erwango suggested that I should open another PR for the dtsi

Maybe I wasn't clear enough, I wanted to mean splitting into disctinct commits, not PRs.

@arifbalik
Copy link
Contributor Author

oh my bad

@arnopo arnopo requested review from erwango and arnopo June 24, 2025 15:14
@arnopo
Copy link
Contributor

arnopo commented Jun 24, 2025

I was trying to bring up ethernet on stm32mp1 and realized the pin data is quite different than what was specified in the default yml file, I'll see if I can put it inside the default one but it seems unlikely.

perhaps you could just add

- name: ETH_MP1x
  match: "^ETH[12]_(CLK|COL|CRS|CRS_DV|GTX_CLK|MDC|MDIO|PHY_INTN|PPS_OUT|REF_CLK|RX_CLK|RX_CTL|RX_DV|RX_ER|RXD[0-3]|TX_CLK|TX_CTL|TX_EN|TX_ER|TXD[0-3])$"
  slew-rate: very-high-speed

@arifbalik
Copy link
Contributor Author

I was trying to bring up ethernet on stm32mp1 and realized the pin data is quite different than what was specified in the default yml file, I'll see if I can put it inside the default one but it seems unlikely.

perhaps you could just add

- name: ETH_MP1x
  match: "^ETH[12]_(CLK|COL|CRS|CRS_DV|GTX_CLK|MDC|MDIO|PHY_INTN|PPS_OUT|REF_CLK|RX_CLK|RX_CTL|RX_DV|RX_ER|RXD[0-3]|TX_CLK|TX_CTL|TX_EN|TX_ER|TXD[0-3])$"
  slew-rate: very-high-speed

The problem is that some of the definitions in the pin data matches some regex expressions inside stm32-pinctrl-config.yaml but not all, so if we just add the expression you provided, we would get some definitions twice.

For example some definitions will match the following regex and this is from stm32-pinctrl-config.yaml

- name: ETH (Extended)
  match: "^ETH\\d+_(?:MDC|MDIO|PHY_INTN|PPS_OUT|CLK|TX_ER)$"
  slew-rate: very-high-speed

But none would match against this;

- name: ETH
  match: "^ETH+_(?:COL$|CRS|CRS_DV|MDC|MDIO|PPS_OUT|REF_CLK|RX_CLK|RX_DV|RX_ER||RXD[0-3]|TX_CLK|TX_EN|TXD[0-3])$"
  slew-rate: very-high-speed

Maybe I could remove the expressions inside EH_MP1x that causes the double match, but then the pinctrl file would call some ETH pins as "extended" even though they are not.

STM32MP1 series has different Ethernet namings than what is specified in stm32-pinctrl-config.yaml, so I did put another config file with one regex; `ETH[12]_(CLK|COL|CRS|CRS_DV|GTX_CLK|MDC|MDIO|PHY_INTN|PPS_OUT|REF_CLK|RX_CLK|RX_CTL|RX_DV|RX_ER|RXD|TX_CLK|TX_CTL|TX_EN|TX_ER|TXD)`

Signed-off-by: Arif Balik <[email protected]>
Updated the pins based on zephyrproject-rtos#287

Signed-off-by: Arif Balik <[email protected]>
@arnopo
Copy link
Contributor

arnopo commented Jun 25, 2025

I was trying to bring up ethernet on stm32mp1 and realized the pin data is quite different than what was specified in the default yml file, I'll see if I can put it inside the default one but it seems unlikely.

perhaps you could just add

- name: ETH_MP1x
  match: "^ETH[12]_(CLK|COL|CRS|CRS_DV|GTX_CLK|MDC|MDIO|PHY_INTN|PPS_OUT|REF_CLK|RX_CLK|RX_CTL|RX_DV|RX_ER|RXD[0-3]|TX_CLK|TX_CTL|TX_EN|TX_ER|TXD[0-3])$"
  slew-rate: very-high-speed

The problem is that some of the definitions in the pin data matches some regex expressions inside stm32-pinctrl-config.yaml but not all, so if we just add the expression you provided, we would get some definitions twice.

For example some definitions will match the following regex and this is from stm32-pinctrl-config.yaml

- name: ETH (Extended)
  match: "^ETH\\d+_(?:MDC|MDIO|PHY_INTN|PPS_OUT|CLK|TX_ER)$"
  slew-rate: very-high-speed

But none would match against this;

- name: ETH
  match: "^ETH+_(?:COL$|CRS|CRS_DV|MDC|MDIO|PPS_OUT|REF_CLK|RX_CLK|RX_DV|RX_ER||RXD[0-3]|TX_CLK|TX_EN|TXD[0-3])$"
  slew-rate: very-high-speed

Maybe I could remove the expressions inside EH_MP1x that causes the double match, but then the pinctrl file would call some ETH pins as "extended" even though they are not.

Is Completing the ETH (Extended) not sufficient?
Could you provide some examples of names that would not match, explaining why? This would help us better understand the issue.

If we are unable to enhance the stm32-pinctrl-config.yaml, an alternative could be to include the changes in stm32mp1-pinctrl-config.yaml to only override the ETH section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants